<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include 'sections/head.phtml'; ?>
</head>
<body id="computer" class="root4">
<?php $items = View::newInstance()->_get('main_categories');
$top_categories=View::newInstance()->_get('top_categories');
?>
<?php include 'sections/header.phtml'; ?>
<div class="clearfix"></div>
<div id="container" class="w"> 
  <!-- SIDE BAR -->
  <?php include template_path().'sections/sidebarhome.phtml'; ?>
  <!-- MAIN CONTENT AREA -->
  <div id="content-area">
        <div id="categories">
	<?php 
	$count=0; // count
	$new_group=true;
	$total=count($top_categories);
	foreach($top_categories as $category) {
		if(0==$count%3) { ?>
		<ul id="category-group-one">
	<?php } ?>
		<li class="category-one"><a href="<?php echo $category->getURI();  ?>" title="<?php echo $category->getURI(); ?>"><?php echo $category->getName(); ?> ( <?php echo $category->getItemCount();?> )</a>
		<?php if($category->hasSubCategories()) { ?>
			<ul class="subcategories">
			<?php $subcats=$category->getSubCategories();
			 	foreach($subcats as $subcategory) {?>
				<li class="subcategory"><a href="<?php echo $subcategory->getURI(); ?>" title="<?php echo $subcategory->getName(); ?>"><?php echo $subcategory->getName(); ?> ( <?php echo $subcategory->getItemCount(); ?> )</a></li>
			<?php } ?>
			</ul>
		<?php } ?>
		</li>
	
	<?php if(2==$count%3 || $count==($total-1)) { ?>
			</ul>  <!-- close group -->
	<?php } ?>
<?php 	$count++; // increase count
} ?>
        
    </div>
  </div>
</div>
<span class="clearfix"></span>
<?php include 'sections/footer.phtml'; ?>
</body>
</html>